Add a function for converting a GdkColor to a string (#373856).
authorMatthew Barnes <mbarnes@redhat.com>
Thu, 21 Dec 2006 12:34:41 +0000 (12:34 +0000)
committerMatthew Barnes <mbarnes@src.gnome.org>
Thu, 21 Dec 2006 12:34:41 +0000 (12:34 +0000)
2006-12-21  Matthew Barnes  <mbarnes@redhat.com>

* docs/reference/gdk/gdk-sections.txt:
* gdk/gdkcolor.[ch] (gdk_color_to_string): Add a function for
converting a GdkColor to a string (#373856).

* configure.in: Bump pango requirement to 1.15.2.

ChangeLog
configure.in
docs/reference/gdk/gdk-sections.txt
gdk/gdkcolor.c
gdk/gdkcolor.h

index bd0843fe85503564b1e3a436a92904f48de82b3a..7375d329f5bdfe431f470dae11470abe39cecc68 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-12-21  Matthew Barnes  <mbarnes@redhat.com>
+
+       * docs/reference/gdk/gdk-sections.txt:
+       * gdk/gdkcolor.[ch] (gdk_color_to_string): Add a function for
+       converting a GdkColor to a string (#373856).
+
+       * configure.in: Bump pango requirement to 1.15.2.
+
 2006-12-20  Matthias Clasen  <mclasen@redhat.com>
        
        * gdk/keynames.txt: Mark arrow keys as translatable.  (#369506,
index 2194f2e6b6aa5a4b8202a3a9c5654fb4c3391648..2e8560719362a1bb7ff91bc60640c3a6f2ae60ad 100644 (file)
@@ -32,7 +32,7 @@ m4_define([gtk_binary_version], [2.10.0])
 
 # required versions of other packages
 m4_define([glib_required_version], [2.12.0])
-m4_define([pango_required_version], [1.12.0])
+m4_define([pango_required_version], [1.15.2])
 m4_define([atk_required_version], [1.9.0])
 m4_define([cairo_required_version], [1.2.0])
 
index b705f999174acc93b80e5d883007d4e3af9c0257..dc89f088b6df0fbe35783e581f98a7f358731423 100644 (file)
@@ -385,6 +385,7 @@ gdk_color_alloc
 gdk_color_change
 gdk_color_equal
 gdk_color_hash
+gdk_color_to_string
 
 <SUBSECTION Standard>
 GDK_COLORMAP
index 83da2cddefec7c04a54a9c23500949d38604a9c1..e533ffcc112671b04fca5956cca978b53c694c97 100644 (file)
@@ -348,6 +348,33 @@ gdk_color_parse (const gchar *spec,
     return FALSE;
 }
 
+/**
+ * gdk_color_to_string:
+ * @color: a #GdkColor
+ *
+ * Returns a textual specification of @color in the hexadecimal form
+ * <literal>&num;rrrrggggbbbb</literal>, where <literal>r</literal>,
+ * <literal>g</literal> and <literal>b</literal> are hex digits
+ * representing the red, green and blue components respectively.
+ *
+ * Return value: a newly-allocated text string
+ *
+ * Since: 2.12
+ **/
+gchar *
+gdk_color_to_string (const GdkColor *color)
+{
+  PangoColor pango_color;
+
+  g_return_val_if_fail (color != NULL, NULL);
+
+  pango_color.red = color->red;
+  pango_color.green = color->green;
+  pango_color.blue = color->blue;
+
+  return pango_color_to_string (&pango_color);
+}
+
 /**
  * gdk_colormap_get_system:
  * 
index 2ab41261b5764a003d68d6d16bec3aa578d03b4a..46f4a645b88796779b85a304b4e05eab412d3314 100644 (file)
@@ -127,13 +127,14 @@ void     gdk_colormap_query_color (GdkColormap *colormap,
 
 GdkVisual *gdk_colormap_get_visual (GdkColormap *colormap);
      
-GdkColor *gdk_color_copy  (const GdkColor *color);
-void      gdk_color_free  (GdkColor       *color);
-gboolean  gdk_color_parse (const gchar    *spec,
-                          GdkColor       *color);
-guint     gdk_color_hash  (const GdkColor *colora);
-gboolean  gdk_color_equal (const GdkColor *colora,
-                          const GdkColor *colorb);
+GdkColor *gdk_color_copy      (const GdkColor *color);
+void      gdk_color_free      (GdkColor       *color);
+gboolean  gdk_color_parse     (const gchar    *spec,
+                              GdkColor       *color);
+guint     gdk_color_hash      (const GdkColor *colora);
+gboolean  gdk_color_equal     (const GdkColor *colora,
+                              const GdkColor *colorb);
+gchar *   gdk_color_to_string (const GdkColor *color);
 
 GType     gdk_color_get_type (void) G_GNUC_CONST;